//引入封装好的接口
import {
  cateList
} from "../../../request/api";
const state = {
  catelist: [],
};

const getters = {
  getCteList(state) {
    return state.catelist;
  },
};

const mutations = {
  REQ_CATELIST(state, payload) {
    state.catelist = payload
  }
};

const actions = {
  async changeCateAction({
    commit
  }) {
    let res = await cateList({
      istree: 1
    });
    commit('REQ_CATELIST', res.list)
  },
};

export default {
  state,
  getters,
  mutations,
  actions,
  //命名空间
  namespaced: true,
};